<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Watson\Validating\ValidatingTrait;

class GgrSchoolContact extends Model
{
    use SoftDeletes;
    use ValidatingTrait;

    protected $table = 'ggr_school_contacts';

    protected $fillable = ['status', 'content'];

    protected $rules = [
        'ggr_schools_id'     => 'required',
        'teacher_id'         => 'required',
        'status'             => 'required',
    ];

    protected $validationMessages = [
        'ggr_schools_id.required'          => '学校必填',
        'teacher_id.required'              => '执行老师必填',
        'status.required'                  => '状态必填',
    ];

    public function teacher()
    {
        return $this->belongsTo('\App\Models\Teacher' , 'teacher_id');
    }


    public function ggrSchool()
    {
        return $this->belongsTo('\App\Models\GgrSchool' , 'ggr_schools_id');
    }

}
